/**
 * 
 */
package systole.domain.persons.identityCard;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import systole.domain.persons.Person;

/**
 * @author jmj
 *
 */
public class IdentityCardType implements Serializable {

    /**
     *
     */
    private static final long serialVersionUID = -7284816134767925491L;
    private Integer id;
    private String description;
    private Set<Person> persons = new HashSet<Person>(0);

    /**
     *
     */
    public IdentityCardType() {
       super();
    }

    /**
     * @param id the id to set
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * @return the id
     */
    public Integer getId() {
        return this.id;
    }

    /**
     * @param description the description to set
     */
    public void setDescription(String description) {
        this.description = description;
    }

    /**
     * @return the description
     */
    public String getDescription() {
        return this.description;
    }

	/**
	 * @return the persons
	 */
	public Set<Person> getPersons() {
		return this.persons;
	}

	/**
	 * @param persons the persons to set
	 */
	public void setPersons(Set<Person> persons) {
		this.persons = persons;
	}

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final IdentityCardType other = (IdentityCardType) obj;
        if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 23 * hash + (this.id != null ? this.id.hashCode() : 0);
        hash = 23 * hash + (this.description != null ? this.description.hashCode() : 0);
        return hash;
    }

    @Override
    public String toString() {
        return  this.description;
    }

    
    
}
